<template>
  <el-container class="home-container">
    <el-header>
      <!-- logo -->
      <img src="../../assets/logoheader.png" alt="" />

      <!-- 导航栏  @select="handleSelect" -->
      <el-menu :default-active="$route.path" class="el-menu-demo" style="width: 500px" mode="horizontal" background-color="rgb(0,21,41)" text-color="#fff" active-text-color="#ffd04b" router>
           <el-menu-item index="/student/sexam">
          <i class="el-icon-collection"></i>
           <span class="ming">考试管理</span>
          </el-menu-item
        >
        <el-menu-item index="/student/smy">
          <i class="el-icon-s-claim"></i>
          <span class="ming">我的考试</span>
         </el-menu-item
        >
      </el-menu>

      <!-- 用户显示信息 -->
      <div class="user">
        <img src="../../assets/pic.jpg" alt="" class="pic" />
        <el-dropdown>
<p class="username">西门吹雪</p>
  <el-dropdown-menu slot="dropdown">
    <el-dropdown-item @click.native="logout">退出</el-dropdown-item>
  </el-dropdown-menu>
</el-dropdown>
      </div>
    </el-header>
    <el-main class="mainbox">
      <router-view></router-view>
    </el-main>
  </el-container>
</template>

<script>
export default {
  methods: {
    logout () {
      window.sessionStorage.clear()
      this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>
.home-container {
  height: 100%;
  width: 100%;
}
.el-header {
  background: rgb(0, 21, 41);
  height: 70px!important;
  // height: 8%;
  display: flex;
  justify-content: space-around;
}

.el-menu-item{
    margin: 5px;
}
.el-submenu__title:hover, .el-menu-item:focus, .el-menu-item:hover{
background-color: rgba(169, 177, 181, 0.5)!important;
}
.ming{
     font-size: 18px;
}
/* 显示用户信息 */
.pic {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  /* padding-top: 8px; */
}
.mainbox{
  padding: 0;
}
.user {
  display: flex;
  justify-content: flex-start;
  padding-top: 5px;
}
.user img {
  text-align: center;
}
.username {
  padding-top: 19px;
  color: white;
  padding-left: 10px;
}
</style>
